<template>
    <div>
        <top-bar class="search-container"
                 :title="title" rightButton=""></top-bar>
        <book-list :listHeight="listHeight" :bookList="bookList"></book-list>
        <wxc-loading :show="isShowLoading" :need-mask="needMask"></wxc-loading>
    </div>
</template>

<script>
    import TopBar from '../components/bar/TopBar';
    import BookList from '../components/search/BookList';
    import {book_store_more} from '../store/actions';
    import {WxcLoading, Utils} from 'weex-ui';
    import {getRealScreenHeight} from '../util/Config';
    export default {
        name: "more",
        components:{TopBar,WxcLoading,BookList},
        data(){
            return {
                moreId: '',
                bookList: [],
                isShowLoading: false,
                needMask: false,
                title: '',
                listHeight: 1344-90,
            }
        },
        mounted(){
            this.isShowLoading = true;
            this.moreId = this.$route.query.moreId || '';
            this.title = this.bookId = this.$route.query.title || '';
            this.listHeight = getRealScreenHeight(Utils) - 90;
            book_store_more({
                params:{
                    moreId: this.moreId
                },
                callback: (data) =>{
                    data.data.forEach(value => {
                        this.bookList.push(value.book);
                    })
                },
                after: ()=>{
                    this.isShowLoading = false;
                }
            })
        },
    }
</script>

<style scoped>

</style>